<?php

namespace App\Models\CarModels;

use Illuminate\Database\Eloquent\Model;

class CarCheck extends Model
{
    //
    protected $table = 'car_check';
    protected $fillable = ['car_id','reason','accept_time','is_accept','is_compete','is_ok','status','has_accident','has_punish','insurance_time','insurance_company','insurance_number','year_check','car_status'];

    public function car(){
        return $this->belongsTo(CarInfo::class,'car_id')->with('kind')->with('push')->with('accident')->with('insurance');
    }
    public function img(){
        return $this->hasMany(CarCheckFiles::class,'check_id')->with('file');
    }

//    public function setCarIdAttribute($value){
//        return null;
//    }

}
